#include "head_c.h"

int userRegisterClient(int net_fd, user_info *info, char *password) {
    info->flag = 0;
    sendInfoStruct(net_fd, info);
    recvInfoStruct(net_fd, info);

    if(info->flag == -1) {
        //用户已存在
        return -1;
    }
    else {
        char *encrypted = crypt(password, info->command_str_return);
        sprintf(info->password, "%s", encrypted);


        //发送密码哈希
        sendInfoStruct(net_fd, info);
    }
    return 1;
} 
